﻿app.service("widgetService", ["$http", function ($http) {
    this.pushMessage = function (widgetId, payload) {
        return $http.post("/dashboard/widget/update", {
            targetWidgetId: widgetId,
            payload: payload,
            origin: "UI"
        });
    };

    this.loadWidgets = function () {
        return $http.get("/dashboard/widget/list", { responseType: "json" });
    };

}]);